﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Contact : System.Web.UI.Page
{
    #region Fields
    private SendMail sendMail;
    #endregion

    #region Page_Load
    protected void Page_Load(object sender, EventArgs e)
    {
     
    }
    #endregion

    #region Methods
    public void ResetForm()
    {
        txtFullname.Text = "";
        txtAddress.Text = "";
        txtPhone.Text = "";
        txtEmail.Text = "";
    }
    protected void  btnReset_Click(object sender, EventArgs e)
    {
          ResetForm();
    }

   
    #endregion
    protected void btnSend_Click(object sender, EventArgs e)
    {
        sendMail = new SendMail();
        string contact = "<b>Name: </b>" + txtFullname.Text 
            + "<b>Email: </b>" + txtEmail.Text.Trim() + "<br/>"
            + "<b>Address: </b>" + txtAddress.Text.Trim() + "<br/>"
            + "<b>Phone Number: </b>" + txtPhone.Text.Trim() + "<br/>"
            + "--------------------------------------------------------<br/>"
            + "<b>Content: </b> <br/>" + txtContent.Text.Trim();
        if (sendMail.SendEMail("InstituteOfFineArts@gmail.com", "1", "Customer", "InstituteOfFineArts@gmail.com", subject, contact  ))
            lblMessage.Text = "We have received your request and will respond in the shortest time. Thank you";     
        else
        {
            lblMessage.Text = "Has an error when sending contact, please do the following. Thank you";
            lblMessage.CssClass = "error";
        }
        ResetForm();
    }

    public string subject { get; set; }
}